// 路由相关类型定义
import React from 'react';

export interface RouteConfig {
  path: string;
  name: string;
  component: React.ComponentType;
  icon?: string;
  title?: string;
  description?: string;
  exact?: boolean;
}

export enum ViewType {
  EDITOR = 'editor',
  DASHBOARD = 'dashboard',
  GRAPH = 'graph',
  SETTINGS = 'settings'
}

export interface ViewState {
  currentView: ViewType;
  previousView?: ViewType;
  viewHistory: ViewType[];
}

export interface NavigationItem {
  id: string;
  label: string;
  icon: string;
  path: string;
  viewType: ViewType;
  badge?: string | number;
  disabled?: boolean;
}

export interface BreadcrumbItem {
  label: string;
  path?: string;
  icon?: string;
}

export interface RouterState {
  currentPath: string;
  currentView: ViewType;
  navigationItems: NavigationItem[];
  breadcrumbs: BreadcrumbItem[];
  isNavigating: boolean;
}

export interface RouterActions {
  navigate: (path: string, viewType?: ViewType) => void;
  goBack: () => void;
  goForward: () => void;
  setNavigationItems: (items: NavigationItem[]) => void;
  setBreadcrumbs: (breadcrumbs: BreadcrumbItem[]) => void;
  updateNavigationBadge: (id: string, badge?: string | number) => void;
}

// 默认导航项配置
export const DEFAULT_NAVIGATION_ITEMS: NavigationItem[] = [
  {
    id: 'editor',
    label: '编辑器',
    icon: 'file-text',
    path: '/editor',
    viewType: ViewType.EDITOR,
  },
  {
    id: 'dashboard',
    label: '仪表板',
    icon: 'bar-chart-3',
    path: '/dashboard',
    viewType: ViewType.DASHBOARD,
  },
  {
    id: 'graph',
    label: '代码图谱',
    icon: 'network',
    path: '/graph',
    viewType: ViewType.GRAPH,
  },
  {
    id: 'settings',
    label: '设置',
    icon: 'settings',
    path: '/settings',
    viewType: ViewType.SETTINGS,
  },
];
